package com.lhn;

import com.lhn.config.SpringConfig;
import com.lhn.dao.BookDao;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author lhn
 * @date 2024-08-19 13:54
 */

public class App11 {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        BookDao bookDao1 = (BookDao) ctx.getBean("bookDao");
        BookDao bookDao2 = (BookDao) ctx.getBean("bookDao");
        System.out.println("bookDao1 is " + bookDao1);
        System.out.println("bookDao2 is " + bookDao2);

        ctx.close();    //关闭容器
    }
}
